#include "Publisher.h"

Publisher::Publisher()
{
	subs = std::list<Subscriber*>();
	subIt = subs.begin();
}

void Publisher::registerSub(Subscriber* sub)
{
	subs.push_back(sub);
}

void Publisher::removeSub(Subscriber* sub)
{
	for(subIt = subs.begin(); subIt != subs.end(); subIt++)
	{
		if(*subIt == sub)
		{
			subs.erase(subIt);
			return;
		}
	}
}
